
from ext import db

print(db, ' <- db ')

class UserModel(db.Model):
    __tablename__ = 't_sysinfo_user'
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(20), unique=True, nullable=False)
    job = db.Column(db.String(60), nullable=False)

    def __repr__(self):
        return f'UserModel:  id: {self.id} , name: {self.name}, job: {self.job} '

    @property
    def to_json(self):
        return {
            'id': self.id,
            'name': self.name,
            'job': self.job
        }
